package org.lewis.demo.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.mybatis.provider.Entity;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;

import java.util.Date;

@Data
@Entity.Table(value = "t_demo_book", remark = "书籍表", autoResultMap = true)
public class TDemoBook {

    @Entity.Column(value = "id", id = true, remark = "主键", updatable = false)
    private String id;

    @Entity.Column(value = "name", remark = "姓名")
    private String name;

    @Entity.Column(value = "isbn", remark = "ISBN")
    private String isbn;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Entity.Column(value = "publish_date", remark = "出版日期", jdbcType = JdbcType.DATE)
    private Date publishDate;

    @Entity.Column(value = "status", remark = "状态（1：有效；0：无效）")
    private String status;

    @Entity.Column(value = "create_time", remark = "创建时间", jdbcType = JdbcType.TIMESTAMP)
    private Date createTime;

    @Entity.Column(value = "update_time", remark = "更新时间", jdbcType = JdbcType.TIMESTAMP)
    private Date updateTime;

}
